interface A{
  name:string,
  age:number
}

interface B{
  name:string,
  age:number,
  sex:string
}


type CustomPartial<T> = {
  [P in keyof T]?:T[P]
}
type CustomRequired<T> = {
  [P in keyof T]-?:T[P]
}

type CustomPick<T,K extends keyof T> = {
  [P in K]:T[P]
}

type C = Partial<A>
type CC = CustomPartial<A>

type D = Required<B>
type DD = CustomRequired<B>

type E = Pick<B,'name' | 'age'>
type EE = CustomPick<B,'name' | 'age'>


type CustomExclude<T,K> = T extends K ? never : T
type F = Exclude<'a'| 'b'|'c','b'>
type FF =CustomExclude<'a'| 'b'|'c','b'>

type CustomOmit<T,K extends keyof T> = {
  [P in Exclude<keyof T,K>]:T[P]
}


type G = Omit<B,'name'>
type GG = CustomOmit<B,'name' | 'age'>

type Key = 'c' | 't' | 'r'
type Value = '唱' | '跳' | 'rap'
type ObjKey = keyof any;
type CustomRecord<K extends keyof any,V> ={
  [P in K]:V
} 

let h:Record<Key,Value> = {
  c:'唱',
  t:'跳',
  r:'唱'
}
let hh:CustomRecord<Key,Value> = {
  c:'唱',
  t:'跳',
  r:'唱'
}

type CustomReturnType<F extends Function> =  F extends (...args:any[]) => infer Res ? Res : never

const fn = () => [1,22,3,'abc',true]

type fnRes = ReturnType<typeof fn>
type fnCustomRes = CustomReturnType<typeof fn>
